<template>
    <div class="left-container">
        <h3>Left 组件</h3>
        <p>msg的值是：{{ msg }}</p>
        <p>user的值是：{{ user }}</p>
        <button @click="send">发送信息给Right组件</button>
    </div>
</template>

<script>
    import bus from './EventBus.js'

    export default {
        props: ['msg', 'user'],
        data() {
            return {
                message: 'hello Right Components!'
            }
        },
        methods: {
            send() {
                bus.$emit('share', this.message)
            }
        }
    }
</script>

<style lang="less" scoped>
.left-container {
    padding: 0 20px 20px;
    background-color: orange;
    min-height: 250px;
    flex: 1;
}
</style>